package org.example;

public class 第十二章_数组 {
    public static void main(String[] args) {
        //创建数组
        int[] myList;
        int[] myArray = new int[10];
        int[] myArray2 = {1,2,4,5,6,7,8,9};

        // 计算所有元素的总和
        double total = 0;
        for (int i = 0; i < myArray2.length; i++) {
            total += myArray2[i];
        }
        System.out.println("myArray2的元素合: "+total);
    }
}
